package com.ice.remoting.data;

public class CommandCustomHeader {

    private static final int RPC_TYPE = 0; // 0, REQUEST_COMMAND

    private int flag = 0;

    private ReceiveTypeEnum receiveType;

    public ReceiveTypeEnum getReceiveType() {
        if (this.isResponseType()) {
            return ReceiveTypeEnum.USER_ISSUE_TYPE;
        }
        return ReceiveTypeEnum.DEVICE_REPORT_TYPE;
    }

    public boolean isResponseType() {
        int bits = 1 << RPC_TYPE;
        return (this.flag & bits) == bits;
    }

    public void markResponseType() {
        int bits = 1 << RPC_TYPE;
        this.flag |= bits;
    }
}
